Updated the runlist timeout path to get correct command idx#1189
Merged
chvamshi-xilinx merged 2 commits intoamd:mainfrom Mar 23, 2026
Merged
Updated the runlist timeout path to get correct command idx#1189chvamshi-xilinx merged 2 commits intoamd:mainfrom
chvamshi-xilinx merged 2 commits intoamd:mainfrom
Conversation
Signed-off-by: Bikash Singha <bisingha@xcobisingha50x.amd.com>
chvamshi-xilinx
approved these changes
Mar 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves VE2 runlist (ERT_CMD_CHAIN) timeout reporting by using CERT’s handshake progress field to populate error_index with the sub-command index that was actually in-flight when the timeout occurred, rather than always reporting index 0.
Changes:
- Update
ve2_cmd_wait()timeout path to readrunlist_read_idxfrom CERT handshake memory and use it to setcc->error_index(with bounds-checking). - Rename the VE2 handshake field
completion_statustorunlist_read_idxto match firmware meaning. - Update debug dump output to print the renamed handshake field.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/driver/amdxdna/ve2_hwctx.c | On timeout for command chains, reads CERT handshake runlist_read_idx to report the correct failing sub-command index and logs diagnostic details. |
| src/driver/amdxdna/ve2_host_queue.h | Renames handshake field to runlist_read_idx to reflect its actual purpose (runlist progress). |
| src/driver/amdxdna/ve2_mgmt.c | Updates handshake debug dump output to print runlist_read_idx. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
Can one of the admins verify this patch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a runlist (command chain) times out, the driver was hardcoding error_index = 0, causing XRT to always report the first sub-command as the timed-out command — regardless of which sub-command actually hung. This made it impossible for userspace to identify the real offending command in a multi-command runlist.
Root Cause
In the timeout path of ve2_cmd_wait(), the driver unconditionally set cc->error_index = 0 with a comment stating this was intentional for the async/timeout case. Unlike the normal error path (where CERT writes completion status per slot), the timeout path fires before CERT has a chance to write per-slot completion. However, CERT does maintain a runlist_read_idx field in the handshake struct (offset 0x70) that tracks how many sub-commands have been processed, which was not being utilized.
Fix
Read runlist_read_idx from the CERT handshake memory via ve2_partition_read_privileged_mem() in the timeout path to determine the actual failing sub-command index. This mirrors the approach already used in the AIE4 driver (aie4_hwctx.c).
Changes
Testing